﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using LetLord.Models;

namespace LetLord.ViewModels
{
    public class BasicPropertySearchViewModel
    {
        public static string[] Counties
        {
            get
            {
                return new string[] { "Anywhere in Ireland", "Carlow", "Cavan", "Clare", "Cork", "Donegal", "Dublin", "--Dublin 1", "--Dublin 2", "--Dublin 3",
                    "--Dublin 4", "--Dublin 5", "--Dublin 6", "--Dublin 6W", "--Dublin 7", "--Dublin 8", "--Dublin 9", "--Dublin 10", "--Dublin 11", "--Dublin 12", 
                    "--Dublin 13", "--Dublin 14", "--Dublin 15", "--Dublin 16", "--Dublin 17 ", "--Dublin 18", "--Dublin 20", "--Dublin 22", "--Dublin 24",
                    "--Dublin County ", "--Dublin North", "--Dublin South ", "Galway", "Kerry", "Kildare", "Kilkenny", "Laois", "Leitrim",
                    "Limerick", "Longforf", "Louth", "Mayo", "Meath", "Monaghan", "Offaly", "Roscommon", "Sligo", "Tipperary",
                    "Waterford", "Westmeath", "Wexford", "Wicklow" };
            }
        }

        public string County { get; set; }
        public string Locality { get; set; }
        public PropertyType PropertyType { get; set; }
        public string SizeSquareMeters { get; set; }
        public string NumberOfBedrooms { get; set; }
        public string NumberOfBathrooms { get; set; }
        public string NumberOfReceptionRooms { get; set; }
        public bool HasBackGarden { get; set; }
        public bool HasFrontGarden { get; set; }
        public bool IsDisabledFriendly { get; set; }
        public bool HasSecureParking { get; set; }
        public decimal MinPrice { get; set; }
        public decimal MaxPrice { get; set; }

        public virtual string PropertyTypeString
        {
            get { return PropertyType.ToString(); }
            set
            {
                PropertyType newValue;
                if (Enum.TryParse(value, out newValue))
                { PropertyType = newValue; }
            }
        }
    }
}